﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="PS_Retirements.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.PS_Retirements" Culture="th-TH" uiCulture="th"%>
<%@ Register src="../Controls/EmployeeTypeCombo.ascx" tagname="EmployeeTypeCombo" tagprefix="uc1" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc2" %>
  
<asp:Content ID="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript" src="../../Scripts/DatePicker.js">      
        </script>     
            <script type="text/javascript">
                function RowDblClick(sender, eventArgs) {
                    PopupRetirementDtls(eventArgs.getDataKeyValue("RETIRE_SEQ"));
                }
                function PopupRetirementDtls(seq) {
                    radopen("PS_RetirementDtls.aspx?Sequence=" + seq, "RetireDtlsWindow");
                }
                function openRadWin() {
                    radopen("PS_RetirementDtls.aspx", "RetireDtlsWindow");
                }

                function closeRadWindow(sender, args) {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest();
                }
                function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }            

            </script>        
    </telerik:RadCodeBlock>
    <title>ประกาศเกษียณอายุราชการ</title>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />    
    <telerik:RadAjaxManager 
        ID="RadAjaxManager1" 
        runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="cmdSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>            
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Height="100%" Width="75px" Transparency="50">
        <table style="height: 100%; width: 100%" border="0">
            <tr>
                <td width="100%" align="center" valign="middle">
                    <img alt="Loading..." 
                        src="../Images/Buttons/loading.gif" 
                        style="border: 0px;" />
                </td>
            </tr>
        </table>     
    </telerik:RadAjaxLoadingPanel>
    <br />
    <asp:panel ID="Panel6" runat="server" >
    <table width="1000" cellpadding="0" cellspacing="0">
        <tr>
            <td width="280" valign = "top">
               <!-- <uc2:user ID="user1" runat="server" /> -->
            </td>
            <td width="20" >
            </td>
            <td>
            <div class="moduleDivSlim700">
                    <div class="moduleDivBottom700">
                         <asp:Panel ID="PanelFilter" runat="server" Width="700px" ScrollBars="Auto">
                            <table align = "center" width = "650px">
                                    <tr>
                                        <td align="right" >
                                            ประเภทบุคลากร :
                                        </td>
                                        <td>
                                            <uc1:EmployeeTypeCombo ID="cbEmployeeType" runat="server" />
                                        </td>
                                        
                                       <td>
                                            <asp:Button ID="cmdFilter" runat="server" onclick="cmdFilter_Click" 
                                                Text="กรองข้อมูล" />
                                        </td>
                                    </tr>
                                </table>
                        </asp:Panel>
                    </div>
                </div>
            </td>
          </tr>
          <tr>
          <td colspan = "3">
        <div class="moduleDivSlim1000">
        <div class="moduleDivBottom1000">
        <table align="center" width ="980px" >
        <tr>
            <td align="left" class="tableHeader">
                ข้อมูลประกาศเกษียณอายุราชการ</td>
        </tr>
        </table>
        <table width ="980px" align="center">
        <tr>
        <td>
        <asp:Panel ID="PanelGrid" 
            runat="server" 
            Width="960px" 
            Height="350px" ScrollBars="Auto" >
                <telerik:RadGrid ID="RadGrid1" runat="server" 
                    AllowAutomaticDeletes="True" 
                    AllowFilteringByColumn="True" 
                    AllowMultiRowEdit="True" 
                    AllowMultiRowSelection="True" 
                    AllowPaging="True" 
                    AllowSorting="True"                     
                    AutoGenerateColumns="False" 
                    EnableAJAX="True" 
                    EnableAJAXLoadingTemplate="True" 
                    GridLines="None" 
                    Width = "950px"
                    OnItemCommand="RadGrid1_ItemCommand"  
                    OnItemDataBound="RadGrid1_ItemDataBound"                      
                    Skin="Outlook">
                    <MasterTableView 
                        AllowMultiColumnSorting="True" 
                        CellSpacing="-1" 
                        CommandItemDisplay="Top" 
                        DataKeyNames="RETIRE_SEQ"
                        ClientDataKeyNames = "RETIRE_SEQ"
                        InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                        NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                        <CommandItemTemplate>
                            <table width="100%">
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="cmdAddNew" runat="server" 
                                            CausesValidation="False" 
                                            CommandName="InitInsert"                                            
                                            Visible="<%# !RadGrid1.MasterTableView.IsItemInserted && RadGrid1.EditIndexes.Count <= 0 %>">
                                        <img style="border:0px;vertical-align:middle;" alt="" 
                                        src="../Images/Buttons/AddRecord.gif"/> จัดทำประกาศ</asp:LinkButton>
                                        &nbsp;&nbsp;
                                    </td>
                                    <td align="right">
                                    </td>
                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" ItemStyle-Width="15">
                                <ItemStyle Width="15px" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridButtonColumn 
                                ButtonType="ImageButton" 
                                CommandName="Delete" 
                                ConfirmDialogType="RadWindow" 
                                ConfirmText="ลบข้อมูลที่เลือก?" 
                                ItemStyle-Width="15" 
                                Text="คลิกเพื่อลบรายการนี้" 
                                UniqueName="column1">
                                <ItemStyle Width="15px" />
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn 
                                DataField="RETIRE_SEQ" 
                                DataType="System.Int32" 
                                Display="False" 
                                HeaderText="RETIRE_SEQ" 
                                ReadOnly="True" 
                                UniqueName="RETIRE_SEQ" 
                                Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="RETIRE_YEAR" 
                                DataType="System.Int32" 
                                Display="False" 
                                HeaderText="RETIRE_YEAR" 
                                ReadOnly="True" 
                                UniqueName="RETIRE_YEAR" 
                                Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="JOB_SITE_NAME" 
                                HeaderStyle-HorizontalAlign="Center"
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false"
                                HeaderText="ประกาศของ" 
                                UniqueName="JOB_SITE_NAME">
                                <HeaderStyle HorizontalAlign="Center" Width="200px"/>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="REF_NO" 
                                HeaderStyle-HorizontalAlign = "Center" 
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false"
                                HeaderText="เลขที่ประกาศ" 
                                UniqueName="REF_NO">
                                <HeaderStyle HorizontalAlign="Center" Width="100px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn
                                DataField="RETIRE_TITLE" 
                                HeaderStyle-HorizontalAlign="Center"
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false" 
                                HeaderText="เรื่อง" 
                                UniqueName="RETIRE_TITLE">
                                <ItemTemplate>
                                    <a href='javascript:PopupRetirementDtls(<%# DataBinder.Eval(Container.DataItem, "RETIRE_SEQ") %>)'>
                                        <b><%# DataBinder.Eval(Container.DataItem, "RETIRE_TITLE") %></b>
                                    </a>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" Width="200px" />
                            </telerik:GridTemplateColumn> 
                            <telerik:GridBoundColumn 
                                DataField="RETIRE_DESCR" 
                                HeaderStyle-HorizontalAlign="Center"
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false" 
                                HeaderText="รายละเอียด" 
                                UniqueName="RETIRE_DESCR">
                                <HeaderStyle HorizontalAlign="Center" Width="200px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="APPROVED_DATE" 
                                DataFormatString = "{0:dd/MM/yyyy}"
                                HeaderStyle-HorizontalAlign="Center" 
                                HeaderText="ประกาศ ณ วันที่" 
                                UniqueName="APPROVED_DATE">
                                <HeaderStyle HorizontalAlign="Center" Width="100px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="RETIRE_STATUS_NAME" 
                                HeaderStyle-HorizontalAlign="Center"
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false"
                                HeaderText="สถานะ" 
                                UniqueName="RETIRE_STATUS_NAME">
                                <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="APPROVED_NAME" 
                                HeaderStyle-HorizontalAlign="Center" 
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false"
                                HeaderText="ผู้อนุมัติ" 
                                UniqueName="APPROVED_NAME">
                                <HeaderStyle HorizontalAlign="Center" Width="150px"/>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="APPROVED_POSITION" 
                                HeaderStyle-HorizontalAlign="Center" 
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false"
                                HeaderText="ตำแหน่ง" 
                                UniqueName="APPROVED_POSITION">
                                <HeaderStyle HorizontalAlign="Center" Width="150px"/>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="START_DATE" 
                                DataFormatString = "{0:dd/MM/yyyy}"
                                HeaderStyle-HorizontalAlign="Center" 
                                HeaderText="มีผลตั้งแต่วันที่" 
                                UniqueName="START_DATE">
                                <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn
                                HeaderStyle-HorizontalAlign="Center"
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false" 
                                HeaderText="" 
                                UniqueName="EXPORT">
                                <ItemTemplate>
                                    <a href='PS_Retirements.aspx?Sequence=<%# DataBinder.Eval(Container.DataItem, "RETIRE_SEQ") %>'>
                                        <img style="border:0px;vertical-align:middle;" alt="โหลดข้อมูลประกาศเกษียร" runat="server" src="~/App_UI/Images/Buttons/backup.gif" width="20" height="20">
                                    </a>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" Width="50px" />
                            </telerik:GridTemplateColumn> 
                        </Columns>
                        <EditFormSettings EditFormType="WebUserControl" 
                            UserControlName="../UserControls/PS_Retirements.ascx">
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>
                        <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                    </MasterTableView>                                      
                    <ClientSettings 
                        AllowColumnHide="True" 
                        AllowColumnsReorder="True" 
                        EnableRowHoverStyle="True" 
                        ReorderColumnsOnClient="True">
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                        <ClientEvents OnRowDblClick="RowDblClick" />
                    </ClientSettings>
                </telerik:RadGrid> 
                </asp:Panel>
                </td>
                </tr>
                </table>
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                    <Windows>
                    <telerik:RadWindow ID="RetireDtlsWindow" runat="server" 
                        Title="รายละเอียดประกาศเกษียณอายุราชการ" 
                        Height="550px"
                        Width="1100px" 
                        ReloadOnShow="true" 
                        ShowContentDuringLoad="false"
                        Modal="true"  
                        OnClientClose="closeRadWindow" />
                    </Windows>
                 </telerik:RadWindowManager>
</div>
</div>
</td>
</tr>
</table>
</asp:panel>
</asp:Content>
